//笔试强训：在字符串中找出连续最长的数字串

#include <iostream>
using namespace std;

int main() {
    string str;
    while (cin >> str) { // 注意 while 处理多个 case
        int mLeft = 0, mRight = 0;
        int left = 0, right = 0;
        int n = str.size();
        for(;right < n; ++right)
        {
            if(str[right] >= '0' && str[right] <= '9')
            {
                left = right;
                while(right < n && str[right] >= '0' && str[right] <= '9'){++right;}
                if(right - left > mRight - mLeft)
                {
                    mLeft = left;
                    mRight = right;
                }
            }
        }
        for(;mLeft < mRight; ++mLeft)
        {
            cout << str[mLeft];
        }
        cout << endl;
    }
}